/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "specificepithet")
@NamedQueries({
    @NamedQuery(name = "Specificepithet.findAll", query = "SELECT s FROM Specificepithet s"),
    @NamedQuery(name = "Specificepithet.findByIdspecificepithet", query = "SELECT s FROM Specificepithet s WHERE s.idspecificepithet = :idspecificepithet"),
    @NamedQuery(name = "Specificepithet.findBySpecificepithet", query = "SELECT s FROM Specificepithet s WHERE s.specificepithet = :specificepithet")})
public class Specificepithet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idspecificepithet")
    private Integer idspecificepithet;
    @Basic(optional = false)
    @Column(name = "specificepithet")
    private String specificepithet;
    @OneToMany(mappedBy = "specificepithet", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Specificepithet() {
    }

    public Specificepithet(Integer idspecificepithet) {
        this.idspecificepithet = idspecificepithet;
    }

    public Specificepithet(Integer idspecificepithet, String specificepithet) {
        this.idspecificepithet = idspecificepithet;
        this.specificepithet = specificepithet;
    }

    public Integer getIdspecificepithet() {
        return idspecificepithet;
    }

    public void setIdspecificepithet(Integer idspecificepithet) {
        this.idspecificepithet = idspecificepithet;
    }

    public String getSpecificepithet() {
        return specificepithet;
    }

    public void setSpecificepithet(String specificepithet) {
        this.specificepithet = specificepithet;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idspecificepithet != null ? idspecificepithet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Specificepithet)) {
            return false;
        }
        Specificepithet other = (Specificepithet) object;
        if ((this.idspecificepithet == null && other.idspecificepithet != null) || (this.idspecificepithet != null && !this.idspecificepithet.equals(other.idspecificepithet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Specificepithet[idspecificepithet=" + idspecificepithet + "]";
    }

}
